import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data,
  })
}

export function register(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}


export function listApi(username){
  return request({
    url: '/user/list',
    method: 'get',
    params: {username}
  })
}

export function updateApi(data){
  return request({
    url: '/user/update',
    method: 'post',
    data
  })
}

export function delUserApi(id){
  return request({
    url: '/user/delete',
    method: 'delete',
    data: {id}
  })
}
